package demoCollections;

import java.util.ArrayList;
import java.util.Collections;
/*
* Collections 是集合工具类，用来对集合进行操作，
*
* */
public class DemoCollections {
    public static void main(String[] args) {
        ArrayList<String> list =new ArrayList<>();
        /*
        * 往集合中添加多个元素 addAll
        * */
        Collections.addAll(list,"a","wang","b");
        System.out.println(list);
        /*
        * 打乱集合中元素的顺序  shuffle
        * */
        Collections.shuffle(list);
        System.out.println(list);
        /*
        * 对集合进行排序 sort
        * sort
        * */
        Collections.sort(list);
        System.out.println(list);
    }
}
